<!--  -->
<template>
	<view class="user">
		<view class="list" v-for="(item,index) in list" :key="item.id" @click="tapSelected(item)">
			<view class="circle">
				<image :src="item.avatar" mode="aspectFill"></image>
			</view>
			<text class="text">{{item.nickname}}</text>
		</view>
		
		<m-loadmore status="nomore"></m-loadmore>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				key:'',
				list:[]
			}
		},
		onLoad(option) {
			this.key=option.key;
			let that = this;
			uni.request({
				url: 'https://ms.ys-n.com/api/index/getlist',
				method: 'POST',
				header:{
					'Content-Type' : 'application/json',
				},
				data: {},
				success: res => {
					console.log(res)
					that.list= res.data.data;
				},
				fail: () => {},
				complete: () => {}
			});
		},
		//页面渲染完成
		mounted() {

		},
		watch: {

		},
		/**
		* 计算属性
		*/
		computed: {

		},
		methods: {
			tapSelected(item){
				uni.navigateTo({
					url:'../index/index?id='+item.id
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.user{
		.list{
			padding: 30rpx 40rpx;
			margin-bottom: 10rpx;
			background-color: #F2F6FC;
			display: flex;
			align-items: center;
			.circle{
				width: 100rpx;
				height: 100rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				background-color: #409EFF;
				color: #FFFFFF;
				font-size: 28rpx;
				font-weight: bold;
				border-radius: 50rpx;
			}
			.text{
				padding-left: 40rpx;
				font-size: 30rpx;
			}
		}
	}
	image{
		height: 100rpx;
		width: 100rpx;
		border-radius: 50rpx;
	}
	
</style>